package com.atchangsha.system.dto;



import com.atchangsha.system.entity.PointEntity;
import lombok.*;

import java.io.Serializable;

@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class PointDTO implements Serializable {
    /**
     * 主键
     */
    private Long id;
    /**
     * 可变积分
     */
    private Long point;
    /**
     * 总积分
     */
    private Integer pointSum;

    /**
     * 将DTO对象转换成entity对象
     *
     * @return entity对象
     */
    public PointEntity toEntity(){
        return PointEntity.builder()
                .id(id)
                .point(point)
                .pointSum(pointSum)
                .build();
    }
}
